<template>
    <div>
        <!-- 时间和按钮盒子，需要给radio,data一个初始值，复制fromatDateTime函数，在mountef中渲染 -->
        <div class="time" style="margin-top:50px">
            <div style="margin-left:5px">{{ date | formatDateTime }}</div>
        </div>

        <div class="Company">
            <div class="Administration">
                <div class="Admin">单位管理</div>
            </div>
            <el-tabs v-model="activeName" @tab-click="handleClick">
                <el-tab-pane label="单位管理" name="0"></el-tab-pane>
                <el-tab-pane label="用户信息" name="1"></el-tab-pane>
            </el-tabs>
            <router-view></router-view>
        </div>
    </div>
</template>
<script>
export default {
    data() {
        return {
            activeName: "0",
            date: new Date(),
        }
    },
    methods: {
        handleClick(tab, event) {
            this.$router.push("/Workbench/Company/" + tab.name);
        }
    },
    filters: {
        formatDateTime(value) {
            let date = new Date(value);
            let y = date.getFullYear();
            let MM = date.getMonth() + 1;
            MM = MM < 10 ? "0" + MM : MM;
            let d = date.getDate();
            d = d < 10 ? "0" + d : d;
            let h = date.getHours();
            h = h < 10 ? "0" + h : h;
            let m = date.getMinutes();
            m = m < 10 ? "0" + m : m;
            let s = date.getSeconds();
            s = s < 10 ? "0" + s : s;
            return y + "年" + MM + "月" + d + "日" + h + ":" + m + ":" + s;
        }
    },
    computed: {
    },
    mounted() {
        var that = this;
        this.timer = setInterval(() => {
            that.date = new Date(); //修改数据date
        }, 1000);
    }
}
</script>
<style>
.Company .el-tabs {
    padding-top: 20px;
}

.Admin {
    margin-top: 20px;
    width: 80px;
    height: 30px;
    font-size: 18px;
    font-weight: 700;
    border-left: 5px solid #3e6ff5;
    padding-left: 20px;


}

.Administration {
    margin-top: 20px;
    padding-top: 15px;
}

.Company {
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 12px 12px 32px #d4d4d4,
        -12px -12px 32px #ffffff;
}
</style>